package com.springBoot.springBootSysCore.modules.entity.system;

import com.springBoot.springBootSysCore.common.comment.annotation.MyComment;
import com.springBoot.springBootSysCore.common.persistence.DataEntity;
import org.springframework.stereotype.Component;

import javax.persistence.*;

/**
 * Created by timo on 2017/11/27.
 */
@Table(name="SYS_MESSAGE_LOG")
@Entity
@MyComment("消息日志")
@Component("sysMessageLog")
public class SysMessageLog extends DataEntity<SysMessageLog>{

    private SysUser sysUser;
    private SysMessage sysMessage;
    private Boolean readed=Boolean.FALSE;//是否已读(true/是,false/否)


    @ManyToOne
    @JoinColumn(name="user_id")
    @MyComment("用户id")
    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }

    @ManyToOne
    @JoinColumn(name="message_id")
    @MyComment("消息id")
    public SysMessage getSysMessage() {
        return sysMessage;
    }

    public void setSysMessage(SysMessage sysMessage) {
        this.sysMessage = sysMessage;
    }

    @Column(name="readed")
    @MyComment("是否已读(true/是,false/否)")
    public Boolean getReaded() {
        return readed;
    }
    public void setReaded(Boolean readed) {
        this.readed = readed;
    }

}
